//
//  ABSettingViewController.swift
//  microblog
//
//  Created by 安波 on 15/11/5.
//  Copyright © 2015年 anbo. All rights reserved.
//

import UIKit

class ABSettingViewController: UITableViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        title = "设置"
        
        setupNavgationItem()
    }
    
    // MARK: - 准备UI
    /// 设置导航栏
    private func setupNavgationItem(){
        
        navigationItem.leftBarButtonItem = UIBarButtonItem(customView: backButton)

    }
    
    // MARK: - 响应事件
    /// 返回
    func back(){
        print(__FUNCTION__)
        navigationController?.popViewControllerAnimated(true)
    }
    
    // MARK: 懒加载
    /// 返回按钮
    private lazy var backButton: UIButton = {
        let button = UIButton()
        
        button.setImage(UIImage(named: "navigationbar_back"), forState: UIControlState.Normal)
        button.setImage(UIImage(named: "navigationbar_back_highlighted"), forState: UIControlState.Highlighted)
        button.sizeToFit()
        
        button.addTarget(self, action: "back", forControlEvents: UIControlEvents.TouchUpInside)
        
        return button
    }()
    
}
